 <link rel="stylesheet" href="../Public/style/user.css" />
<script>
function sub_save(){
	
	$("#myform2").submit();
	}

function sub_savea(){
	
	$("#myform3").submit();
	}
</script>
 <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}</div>
	 </div>
 <include file="Mobile:nav"/> 
 {if $vo['email']}    	 
<form  id="myform2" method="post" action="{:U('Mobile/User/delemail')}" >
	 <div class="U_padding sb_user find_poss">
		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon3 icon_com"></em>
				 <input  type="text" placeholder="邮箱" value="{$vo['email']}" id="email" name="mail" class="reg-form-input rf-input-l"/>
			 </div>
			 
		 </div>

<div class="text clear">
			 <div class="sb_text2">
				 <em class="icon4 icon_com"></em>
				 <input type="text" name="verify" class="text2"  placeholder="请输入验证码" />
			 </div>

			 
              <input type="button"   class="send" id="wind_spans4" value="获取验证码" />
			 
		 </div>

		

		 

		 <a href="javascript:sub_save();" class="register">
			解绑
		 </a>
	 </div>
 </form>
{else}
<form  id="myform3" method="post" action="{:U('Mobile/User/addemail')}" >
	 <div class="U_padding sb_user find_poss">
		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon3 icon_com"></em>
				 <input type="text" placeholder="邮箱" value="" id="email" name="mail" class="reg-form-input rf-input-l"/>
			 </div>
			 
		 </div>

<div class="text clear">
			 <div class="sb_text2">
				 <em class="icon4 icon_com"></em>
				 <input type="text" name="verify" class="text2"  placeholder="请输入验证码" />
			 </div>

			 
              <input type="button"   class="send" id="wind_spans4" value="获取验证码" />
			 
		 </div>

		

		 

		 <a href="javascript:sub_savea();" class="register">
			绑定
		 </a>
	 </div>
 </form>



{/if} 
 
 <script>
 
 $('#wind_spans4').click(function(){
       var mail = $.trim($('#email').val());
       var partten = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
	   //alert(mail)
	  if(partten.test(mail)){
		  $.post('index.php?g=User&m=Index&a=email', {'mail':mail},function(res){
               alert(res);
			  
			  
           });
		 }else{alert('邮箱格式不正确')}
    }); 
	 
 
 </script>